let vm = null;

const sendThis = (_this) => {
  console.log(_this, 'this')
  vm = _this;
};
export default {
  sendThis,
  //查看分组人员
  groupCheckColumns: [{
    title: '序号',
    key: 'name',
    minWidth: 60,
    align: 'center',
    render(h, params) {
      return h('div', params.row._index - 0 + 1)
    },
  },
  {
    title: '姓名',
    key: 'userName',
    minWidth: 100,
    align: 'center',
    render: (h, params) => {
      return h('div', params.row.userName ? params.row.userName : '-')
    },
  },
  {
    title: '工号',
    key: 'workNo',
    minWidth: 100,
    align: 'center',
    render: (h, params) => {
      return h('div', params.row.workNo ? params.row.workNo : '-')
    },
  },
  {
    title: '手机号',
    key: 'phone',
    minWidth: 150,
    align: 'center',
    render: (h, params) => {
      return h('div', params.row.phone ? params.row.phone : '-')
    },
  },
  {
    title: '是否组长',
    key: 'groupLeader',
    minWidth: 80,
    align: 'center',
    render: (h, params) => {
      return h(
        'div',
        params.row.groupLeader ? (params.row.groupLeader == 1 ? '是' : '否') : '-'
      )
    },
  },
  {
    title: '操作',
    width: 200,
    align: 'center',
    render: (h, params) => {
      return h('div', [
        h(
          'a', {
            style: {
              marginLeft: '10px',
            },
            on: {
              click: (e) => {
                e.stopPropagation()
                vm.onChangeLog(params.row, 'check') //点击事件
              },
            },
          },
          '变更记录'
        ),
      ])
    },
  }, ],
  //编辑分组人员
  groupEditColumns: [{
    title: '序号',
    key: 'name',
    width: 70,
    align: 'center',
    render(h, params) {
      return h('div', params.row._index - 0 + 1)
    },
  },
  {
    title: '姓名',
    key: 'userName',
    width: 90,
    align: 'center',
    render: (h, params) => {
      return h('div', params.row.userName ? params.row.userName : '-')
    },
  },
  {
    title: '工号',
    key: 'workNo',
    minWidth: 90,
    align: 'center',
    render: (h, params) => {
      return h('div', params.row.workNo ? params.row.workNo : '-')
    },
  },
  {
    title: '手机号',
    key: 'phone',
    minWidth: 130,
    align: 'center',
    render: (h, params) => {
      return h('div', params.row.phone ? params.row.phone : '-')
    },
  },
  {
    title: '是否组长',
    key: 'groupLeader',
    minWidth: 100,
    align: 'center',
    render: (h, params) => {
      return h(
        'div',
        params.row.groupLeader ?
        params.row.groupLeader == 1 ?
        '是' :
        '否' :
        '-'
      )
    },
  },
  {
    title: '操作',
    minWidth: 200,
    align: 'center',
    render: (h, params) => {
      return h('div', [
        h(
          'a', {
            style: {
              marginRight: '10px',
              color: params.row.groupLeader != 1 && vm.IsLeader ? '#ccc' : '',
            },
            on: {
              click: (e) => {
                e.stopPropagation()
                vm.setLeaderFun(params.row) //点击事件
              },
            },
          },
          params.row.groupLeader == 1 ? '取消组长' : '设为组长'
        ),
        h(
          'a', {
            style: {
              marginRight: '10px',
              // display: vm.data && vm.data.length > 1 ? 'inline-block' : 'none'
            },
            on: {
              click: (e) => {
                e.stopPropagation()
                vm.delGroupUserFun(params.row) //点击事件
              },
            },
          },
          '移除小组'
        ),
        h(
          'a', {
            style: {
              // display: vm.data && vm.data.length > 1 ? 'inline-block' : 'none'
            },
            on: {
              click: (e) => {
                e.stopPropagation()
                vm.onChangeLog(params.row, 'edit') //点击事件
              },
            },
          },
          '修改'
        ),
      ])
    },
  }, ],
}